function getComputStyleIf(oHtml,dim,def) {
//=====================
 if (   !oHtml
     || (   !window.getComputedStyle 
         && !oHtml.currentStyle)
     || (getComputStyleStr(oHtml,'display') == 'none')){
   return 0;
 }
 else
   return getComputStyle(oHtml,dim,def);
}

function getComputStyle(oHtml,dim,def) {
//=====================
// def = val par default si 0 ou undef

if (def) {
 return (window.getComputedStyle) ? parseInt(window.getComputedStyle(oHtml,null)[dim]  || def)
                                  : parseInt(oHtml.currentStyle[dim] || def)
}
else{
// traceExec('oHtml='+oHtml+' dim='+dim,61);
 return (window.getComputedStyle) ? parseInt(window.getComputedStyle(oHtml,null)[dim])
                                  : parseInt(oHtml.currentStyle[dim]);
}
}
function getComputStyleStr(oHtml,dim,def) {
//=====================
// def = val par default si 0 ou undef
 if (def) {

  return (window.getComputedStyle ? window.getComputedStyle(oHtml,null)[dim]  || def
                                  : oHtml.currentStyle[dim] || def);
 }
 else{//alert('oHtml.id= '+oHtml.id+' type dim = '+dim);
  return (window.getComputedStyle ? window.getComputedStyle(oHtml,null)[dim]
                                  : oHtml.currentStyle[dim]);
//                                  : oHtml.currentStyle ? oHtml.currentStyle[dim] : 0);
 }
}


getBorderStyle = function (oHtml) {
//==========================
// approximatif a revoir
var bBorder;
  if (!window.getComputedStyle) {
    traceExec('nd.currentStyle.borderWidth = '+oHtml.currentStyle.borderWidth ,20);
//    bBorder =  nd.currentStyle.borderWidth
    bBorder =  (   (getComputStyleStr(oHtml,'borderStyle') != 'none')
                && (getComputStyleStr(oHtml,'borderStyle') != ''));
    traceExec('getComputStyleStr(oHtml,borderStyle)= '+getComputStyleStr(oHtml,'borderStyle'),20);
  }
  else
    bBorder =   (getComputStyle(oHtml,'borderTopWidth') != 0);

  traceExec('getBorderStyle= '+bBorder,20);
  return bBorder;

}
getBorderWidth = function (oHtml) {
//===============================
// approximatif a revoir
 return (window.getComputedStyle) ? parseInt(window.getComputedStyle(oHtml,null)['borderTopWidth'])
                                  : getBorderStyle (oHtml)
                                          ? parseInt(oHtml.currentStyle['borderWidth'])
                                          : 0;
}

borderIfNecess = function (oHtml) {
   return ( (window.getComputedStyle) ? 
                                       (  parseInt(window.getComputedStyle(oHtml,null)['borderTopWidth'])
                                        + parseInt(window.getComputedStyle(oHtml,null)['borderBottomWidth']))
                                      : 0);
}
